Skip to content

[codex] Add Moonshot Kimi backend provider#639

Merged
jahooma merged 2 commits into
mainfrom
jahooma/add-moonshot-kimi-k2-6
May 11, 2026
Merged

[codex] Add Moonshot Kimi backend provider#639
jahooma merged 2 commits into
mainfrom
jahooma/add-moonshot-kimi-k2-6

Conversation

@brandonkachen
Copy link
Copy Markdown
Collaborator

Summary

Adds a direct Moonshot chat completions provider implementation for Kimi K2.6, including request normalization, streaming/non-streaming billing, provider error pass-through, usage parsing, and MOONSHOT_API_KEY env wiring.

This PR intentionally preserves current production routing for moonshotai/kimi-k2.6: that model still routes through OpenCode Zen. The new Moonshot provider path is wired into the routing code, but OpenCode Zen has precedence for the existing Kimi alias so production behavior does not change yet.

Validation

  • CI=true bun test web/src/app/api/v1/chat/completions/__tests__/completions.test.ts web/src/llm-api/__tests__/kimi-tool-compat.test.ts
  • CI=true bun test common/src/__tests__/env-ci.test.ts common/src/__tests__/env-process.test.ts
  • bun run --cwd web typecheck
  • bun run --cwd packages/internal typecheck
  • git diff --check

Live checks

  • Direct Moonshot API call with MOONSHOT_API_KEY returned a real kimi-k2.6 response.
  • Local web server on port 3010 handled a BuffBench base2-free-kimi run end-to-end through the backend. The BuffBench task scored 6.8/10; its task-level failures were from the agent's code attempt, not provider routing.

@jahooma jahooma force-pushed the jahooma/add-moonshot-kimi-k2-6 branch from 25ee84a to ce47375 Compare May 11, 2026 04:08
@jahooma jahooma marked this pull request as ready for review May 11, 2026 04:18
@jahooma jahooma merged commit 3c626e9 into main May 11, 2026
35 checks passed
@jahooma jahooma deleted the jahooma/add-moonshot-kimi-k2-6 branch May 11, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants